{extend name="template/base" /}
{block name="content"}
<!--select2样式 start -->
<link href="__LIB__/select2-4.0.3/dist/css/select2.min.css" rel="stylesheet" />
<br><br><br>
<div class="page-container">
    <form class="form form-horizontal" id="form" method="post" action="{:\\think\\Request::instance()->baseUrl()}">
        <input type="hidden" name="id" value="{$vo.id ?? ''}">
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>汽车品牌：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <!--<div class="select-box">-->
                    <select name="car_brand_id" id="car_brand_id" class="select2" datatype="*" nullmsg="汽车品牌不能为空">
                        <option value="">请选择车辆品牌</option>
                        {foreach list as $vo2}
                            <option {if ($vo2['id'] == $vo['id'])} selected {/if} value="{$vo2.id}">{$vo2.brand_name}</option>
                        {/foreach}
                    </select>
                <!--</div>-->
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>汽车型号：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="汽车型号" name="car_model" value="{$vo.car_model ?? ''}"  datatype="*" nullmsg="汽车型号不能为空">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>座位数：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <!--<input type="text" class="input-text" placeholder="汽车型号" name="seat" value="{$vo.seat ?? ''}"  datatype="*" nullmsg="汽车座位数">-->
                <div class="select-box">
                    <select name="seat" class="select" datatype="*" nullmsg="汽车座位数不能为空">
                        <option value="">请选择座位数</option>
                        {foreach seats as $vo1}
                        <option {if ($vo1['value']==$vo['seat'])} selected {/if}value="{$vo1.value}">{$vo1.name}</option>
                        {/foreach}
                    </select>
                </div>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>百公里油耗量：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="百公里油耗量" name="oil_consumption" value="{$vo.oil_consumption ?? ''}"  datatype="*" nullmsg="百公里油耗量不能为空">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <button type="submit" class="btn btn-primary radius">&nbsp;&nbsp;提交&nbsp;&nbsp;</button>
                <button type="button" class="btn btn-default radius ml-20" onClick="layer_close();">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
            </div>
        </div>
    </form>
</div>
{/block}
{block name="script"}
<script type="text/javascript" src="__LIB__/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="__LIB__/select2-4.0.3/dist/js/select2.min.js"></script>

<script type="text/javascript" charset="utf-8" src="__LIB__/tags-input/dist/jquery.tagsinput.js"></script>
<script type="text/javascript" charset="utf-8" src="__LIB__/tags-input/dist/jquery-ui.js"></script>
<link rel="stylesheet" type="text/css" href="__LIB__/tags-input/dist/jquery-ui.css" />
<script>
    $(function () {
        $("[name='arctic_id']").find("[value='{$vo.arctic_id ?? ''}']").attr("selected", true);
        $("[name='car_brand_id']").find("[value='{$vo.car_brand_id ?? ''}']").attr("selected", true);;

        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });

        $("#form").Validform({
            tiptype: 2,
            ajaxPost: true,
            showAllError: true,
            callback: function (ret){
                ajax_progress(ret);
            }
        });
        //用户select2 js部分 start
        var car_brand_id = $("#car_brand_id").select2({
            language: "zh-CN", //设置 提示语言
            width: "100%", //设置下拉框的宽度
            theme: "classic"
        });
        {notempty name = "vo['car_brand_id']"}
        car_brand_id.val("{$vo['car_brand_id']}").trigger("change");
        {/notempty}
            //用户select2 js部分 end
    })
</script>
{/block}
